package com.chapter.sample.answer.aopreview;

/**
 * 静态代理
 */
public class PayProxy implements PayService {
    private PayService payService;

    public PayProxy(PayService payService) {
        this.payService = payService;
    }

    public void before() {
        System.out.println("-------before，开打微信");
    }

    @Override
    public void pay() {
        before();
        payService.pay();
        after();
    }

    public void after() {
        System.out.println("-------after，关闭微信");
    }
}
